import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '登录',
      component: Login,
    },
    {
      path: '/index',
      name: '主页',
      component: () => import('../layout/index.vue'),
      redirect: "/home",
      children: [
        {
          path: '/home',
          name: '首页',
          component: () => import('../views/Home.vue'),
        },
        {
          path: '/system',
          name: '系统管理',
          // component: () => import('../layout/index.vue'),
          redirect: "/system/useranage",
          children: [
            {
              path: '/system/useranage',
              name: '系统管理/用户管理',
              component: () => import('../views/system/Useranage.vue'),
            }
          ]
        },

        {
          path: '/dataMonitoring',
          name: '数据监控',
          // component: () => import('../layout/index.vue'),
          redirect: "/components/log",
          children: [
            {
              path: '/components/log',
              name: '数据监控/日志管理',
              component: () => import('../views/components/Log.vue'),
            },
            {
              path: '/components/vip',
              name: '数据监控/Vip管理',
              component: () => import('../views/components/Vip.vue'),
            },
            {
              path: '/components/feedback',
              name: '数据监控/反馈管理',
              component: () => import('../views/components/Feedback.vue'),
            },
            {
              path: '/components/coupon',
              name: '数据监控/优惠券管理',
              component: () => import('../views/components/Coupon.vue')
            }

          ]
        },
        {
          path: '/clientele',
          name: '客户管理',
          // component: () => import('../layout/index.vue'),
          redirect: "/clientele/patriarch",
          children: [
            {
              path: '/clientele/patriarch',
              name: '客户管理/家长管理',
              component: () => import('../views/clientele/Patriarch.vue')
            }

          ]
        },
        {
          path: '/systemSettings',
          name: '系统设置',
          // component: () => import('../layout/index.vue'),
          redirect: "/systemSettings/aboutUs",
          children: [
            {
              path: '/systemSettings/aboutUs',
              name: '系统设置/关于我们',
              component: () => import('../views/systemSettings/AboutUs.vue')
            },

          ]
        },
        {
          path: '/ai',
          name: 'AI',
          // component: () => import('../layout/index.vue'),
          redirect: "/ai/dialogue",
          children: [
            {
              path: '/ai/dialogue',
              name: 'AI/AI对话',
              component: () => import('../views/ai/Dialogue.vue')
            },

          ]
        }


      ]
    },
  ],
})
export default router
